//
//  MyOfferBottomView.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/3.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MyOfferBottomView.h"

@interface MyOfferBottomView ()

@end

@implementation MyOfferBottomView

-(id)initWithFrame:(CGRect)aFrame inSuperView:(UIView *)aSuperView{
    if (self = [super initWithFrame:aFrame inSuperView:aSuperView]) {
        self.backgroundColor = [UIColor whiteColor];
        NSArray * titArr = @[@"太贵放弃",@"中标"];
        for (int i=0; i<2; i++) {
            GLGWButton * bottomBut = [[GLGWButton alloc] initWithFrame:CGRectMake(KScreenWidth - kWidthProportion_In_iPhoneTriploid(191) + kWidthProportion_In_iPhoneTriploid(88)*i, kHeightProportion_In_iPhoneTriploid(10), kWidthProportion_In_iPhoneTriploid(88), kHeightProportion_In_iPhoneTriploid(40)) hTitle:titArr[i] titleLableFont:SYSTEMFONT(12) titleLableColor:[UIColor whiteColor] theCornerRadius:0 backgroundColr:kColor_Rule_Yellow inSuperView:self];
            if (i==0) {
                bottomBut.backgroundColor = [UIColor colorWithHexString:@"#A89A60" alpha:0.61];
                UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bottomBut.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerBottomLeft) cornerRadii:CGSizeMake(bottomBut.frame.size.height/2,bottomBut.frame.size.height/2)];//圆角大小
                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
                maskLayer.frame = bottomBut.bounds;
                maskLayer.path = maskPath.CGPath;
                bottomBut.layer.mask = maskLayer;
            }else{
                UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bottomBut.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight) cornerRadii:CGSizeMake(bottomBut.frame.size.height/2,bottomBut.frame.size.height/2)];//圆角大小
                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
                maskLayer.frame = bottomBut.bounds;
                maskLayer.path = maskPath.CGPath;
                bottomBut.layer.mask = maskLayer;
            }
        }
        //
        GLGWButton * confBut = [[GLGWButton alloc] initWithFrame:CGRectMake((KScreenWidth - kWidthProportion_In_iPhoneTriploid(191) - kWidthProportion_In_iPhoneTriploid(100))/2, 0, kWidthProportion_In_iPhoneTriploid(100), self.height) hTitle:@"联系报价人" titleLableFont:SYSTEMFONT(10) titleLableColor:[UIColor colorWithHexString:@"#999999"] theCornerRadius:0 backgroundColr:[UIColor whiteColor] inSuperView:self];
//        confBut.backgroundColor = kRandomColor;
        [confBut setImage:[UIImage imageNamed:@"icon_dianhua"] forState:UIControlStateNormal];
        [confBut setImagePositionWithType:SSImagePositionTypeTop spacing:6];
    }
    return self;
}

@end
